function E2=functionM(E)

%Implements the mapping to get signed errors into the 0..255 interval
sig=sign(E);
E2=2*sig.*E + (sig==-1);